<script type="text/javascript">
function show_this(hidden_div)
{
	$("#"+hidden_div).css({'visibility':'visible'});
}
function hide_this(hidden_div)
{
	$("#"+hidden_div).css({'visibility':'hidden'});
}
function bulk()
{
	var ids = $("input[name='bank_id[]']").serialize();
	if(confirm("Anda ingin menghapus?"))
	{
		if (ids)
		{
			$.ajax({
				type: "POST",
				url: "<?php echo site_url().'backend/bank/ajax_bulk_action/' ?>",
				cache: false,
				data: ids,
				success: window.location.reload(),
			});
		}
	}
}
//jQuery
$(function(){
$(".check_all").click(function()
	{
		var checked_status = this.checked;
		$(":checkbox").each(function()
		{
		this.checked = checked_status;
		});
	});
});
</script>
<script type="text/javascript">
      $(document).ready(function() {
        setTimeout(function(){
          $("#kotak").fadeOut("slow", function () {
            $("#kotak").remove();
          });    
        }, 3000);
      });
</script>
<div class="left"></div>
<div class="right"></div>
<div class="heading">
	<h1 style="background-image: url('<?php echo base_url()?>assets/images/order.png');">Master Data</h1>
</div>
<div class="wrapper">
<h1>Rekening Bank</h1>
<div class="table_filter_wrapper">
	<a href="<?php echo site_url('backend/bank/add')?>"><input type="submit" name="add" value="Tambah"></a>
	<input type="button" onclick="bulk()" value="Hapus"><br>
	<?php echo $this->session->flashdata('message_type');?>
</div>
	<table>
		<thead>
			<tr>
				<th style="width:5%"><input class="check_all" type="checkbox" ></th>
				<th style="width:5%">No</th>
				<th style="width:40%">Atas Nama</th>
				<th style="width:25%">Nama Bank</th>
				<th style="width:25%">No Rekening</th>
			</tr>
		</thead>
		<?php
			$no = 1 + $urut;
			foreach($res as $row):
		?>
		<tr class="<?php if ($no %2 == 0) echo 'even';?>">
			<td><input type="checkbox" name="bank_id[]" value="<?php echo $row['bank_id']?>"></td>
			<td><?php echo $no;?></td>
			<td onMouseOver="show_this('action-<?php echo $row['bank_id']?>')"
			onMouseOut="hide_this('action-<?php echo $row['bank_id']?>')">
			<b><?php echo anchor('backend/bank/edit/'.$row["bank_id"].'/'.$row["nama_rek"],$row["nama_rek"]);?></b>
			<div id="action-<?php echo $row['bank_id']?>" class="action invisible">
				<?php echo anchor('backend/bank/edit/'.$row["bank_id"],'Edit')?> |
				<?php echo anchor('backend/bank/delete/'.$row["bank_id"].'/'.$no,'Hapus',array('onclick' => "return confirm('Anda yakin menghapus data ini?')"))?>
			</div>
			</td>
			<td><?php echo $row['nama_bank']?></td>
			<td><?php echo $row['no_rek']?></td>
		</tr>
		<?php
			$no++;
			endforeach;
		?>
	</table>

<?php if($this->pagination->create_links()==TRUE):?>
<p id="pagination">Halaman : <?php echo $this->pagination->create_links(); ?></p>
<?php endif; ?>
</div>
